<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter Form Helper
 *
 * Override build-in form_helper with new function for FCKEDITOR
 *
 * @package		CodeIgniter
 * @subpackage	Helpers
 * @category	Helpers
 * @author		locdo@penwoodtech.com
 */
include_once( BASEPATH . '/helpers/form_helper'.EXT);

function form_fckeditor($name='',$value='',$height='200',$width='100%'){
    $CI =& get_instance();
    $fckeditor_basepath = $CI->config->item('fckeditor_basepath');    
    require_once($_SERVER["DOCUMENT_ROOT"].$fckeditor_basepath.'fckeditor.php');    
    $fckeditor = new FCKeditor($name);    
    if( $fckeditor->IsCompatible()){        		
        $fckeditor->BasePath = $fckeditor_basepath;        
        $fckeditor->ToolbarSet = 'Standar';
		$fckeditor->Config['SkinPath'] = $fckeditor_basepath.'editor/skins/office2003/';		
		$fckeditor->Height = $height;
        $fckeditor->Width = $width;
		$fckeditor->Value = html_entity_decode($value,ENT_NOQUOTES,'UTF-8');		
        return $fckeditor->CreateHtml();
    }
	else{ 
		return form_textarea($name,$value,'');
	}
}
/* End of file */